import React, { Component } from 'react'
import './Parent.css'
import { Child } from './Child'
export class Parent extends Component {
  state = {
    money: 100
  }

  giveMoney = (money) => {
    console.log(money);
    this.setState({
      money: money
    })
  }
  render() {
    return (
      // 父组件
      <div className="parent">
        <h1>父组件</h1>
        <Child money={this.state.money} giveMoney={this.giveMoney} />
      </div>
    )
  }
}